<template>
	<view style="padding:50rpx;">
		
		<!-- 利用模态对话框弹出协议  -->
				<gui-modal 
				ref="guimodal" 
				width="660rpx" 
				:isCloseBtn="false" 
				title="用户协议及隐私政策">
					<scroll-view 
					scroll-y 
					slot="content" 
					:style="{height:contentHeight+'px'}"
					class="gui-bg-gray">
						<text class="gui-block-text gui-text" 
						style="line-height:50rpx; padding:25rpx;">感谢您对我们一直以来的信任！我们根据最新的监管要求更新了我们的
						</text>
						<text class="gui-block-text gui-text gui-color-blue"
						style="line-height:50rpx; padding:25rpx;" @tap="goto_user_agree()">《用户协议》
						</text>
						<text class="gui-block-text gui-text gui-color-blue"
						style="line-height:50rpx; padding:25rpx;" @tap="goto_privacy_agree()">《隐私政策》
						</text>
						<text class="gui-block-text gui-text"
						style="line-height:50rpx; padding:25rpx;">为了更好的保护您的隐私和信息安全，请您在使用前务必仔细阅读和理解。若您同意更新后的隐私政策，请点击同意并继续使用我们的产品和服务。
						</text>
						
						<view class="gui-flex gui-margin-top" style="width: 600rpx;margin-left: 20rpx;">
							<button type="default" class="gui-button gui-bg-green" open-type="getPhoneNumber"
								@getphonenumber="onGetPhoneNumber" style="border-radius: 20rpx;width: 200rpx;margin-left: 30rpx;">
								<text class="gui-icons gui-color-white gui-bold">同意</text>
							</button>
							
							<button type="default" class="gui-button gui-bg-gray" style="border-radius: 20rpx;width: 200rpx;margin-left: 100rpx;" @tap="no_agree()">
								<text class="gui-icons gui-color-blue gui-bold">不同意</text>
							</button>
						</view>
						
					</scroll-view>
					
					
					
					
					
				</gui-modal>
		
		<view style="height:150rpx;"></view>
		<view class="gui-flex gui-rows gui-justify-content-center">
			<text
				class="login-logo gui-icons gui-color-white gui-block-text gui-border-box gui-bg-blue gui-box-shadow gui-box">&#xe762;</text>

		</view>
		<view class="gui-flex gui-rows gui-justify-content-center gui-margin-top">
			<text class="gui-text-center gui-h4 gui-bold">知福台球</text>
		</view>
		<view style="margin-top:80rpx;">
			

				<view style="margin-top:38rpx;">
					<button type="default" class="gui-button gui-bg-green" @tap="mobile_login()"
						style="border-radius:50rpx;">
						<text class="gui-color-white gui-button-text gui-bold">手机号快捷登录</text>
					</button>
				</view>
			
		</view>

		


	</view>
</template>
<script>
	var graceChecker = require("@/GraceUI5/js/checker.js");
	export default {
		data() {
			return {
				
				is_agree:0,
				contentHeight : 400
			}
		},
		onLoad:function(query){
			this.$globalMethod();
		},
		methods: {
			onGetPhoneNumber(e) {
				console.log(e);
				this.graceJS.post(this.serverUrl + '/api.wechat/get_phone_number', {
						code: e.detail.code,
						encryptedData: e.detail.encryptedData,
						iv: e.detail.iv
					}, 'form', {
						token: this.token
					}, (res) => {
						if(res.code==0){
							uni.showToast({
								title:'登录成功',
								icon:'none'
							});
							
							uni.reLaunch({
								url:'/pages/index/index'
							})
						}else{
							uni.showToast({
								title:res.msg,
								icon:'error'
							});
						}
					},
					(e) => {
						uni.showToast({
							title:e.msg,
							icon:'error'
						});
					})
			},
			mobile_login(){
				this.$refs.guimodal.open();
			},
			no_agree(){
				this.$refs.guimodal.close();
			},
			goto_user_agree(){
				uni.navigateTo({
					url:'/pages/index/user_agree'
				})
			},
			goto_privacy_agree(){
				uni.navigateTo({
					url:'/pages/index/privacy_agree'
				})
			}
		}
	}
</script>
<style>
	.modal-btns{line-height:100rpx; height:100rpx; font-size:35rpx; text-align:center; width:320rpx;}
	.login-logo {
		width: 180rpx;
		height: 180rpx;
		font-size: 80rpx;
		text-align: center;
		line-height: 120rpx;
		padding: 30rpx;
		border-radius: 18rpx;
	}

	.other-login-icons {
		width: 88rpx;
		height: 88rpx;
		text-align: center;
		font-size: 70rpx;
		margin: 20rpx;
	}

	.sendmsg {
		height: 30rpx;
		width: 200rpx;
		font-size: 24rpx;
		line-height: 30rpx;
	}
</style>